package com.qingcheng.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.business.AdService;
import com.qingcheng.service.goods.CategoryService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class IndexController {

    @Reference
    private AdService adService;

    @Reference
    private CategoryService categoryService;


    @GetMapping("/index")
    public String index(Model model){

        System.out.println("----------------->Controller");
        //轮播图读取
        //List<Ad> index_lb = adService.findByPosition("index_lb");
        //List<Ad> index_lb = adService.findByPosition_redis("index_lb");//从缓存中找
        //model.addAttribute("lbt",index_lb);
        //菜单读取
       // List<Map> categoryTree = categoryService.findCategoryTree();
        //List<Map> categoryTree = categoryService.findCategoryTree_redis();//从缓存中找
        //addAttribute("categoryTree",categoryTree);
        return "index";
    }



}
